using System;
using L=Science.Physics.GeneralPhysics;

namespace Serway.Chapter10
{
	/// <summary>
	/// Example03: The Oxygen Molecule
	/// Consider an oxygen molecule (O_2) rotating the xy plane 
	/// about the z axis. The rotating axis passes through 
	/// the center of the molecule, perpendicular to its length. 
	/// The mass of each oxygen atom is 2.66 \times 10^{-26} kg, 
	/// and at room temperature the average separation between the two atoms 
	/// is d=1.21 \times 10^{-10} m (The atoms are modeled as particles.)
	/// (A) Calculate the moment of inertia of the molecule about 
	/// the z axis.
	/// I = 1.95 \times 10^{-46} kg m^2
	/// (B) If the angular speed of the molecule about the z axis 
	/// is 4.60 \times 10^{12} rad/s, what is its rotational kinetic energy?
	/// K = 2.06 \times 10^{-21} J
	/// </summary>
	public class Example03
	{
		public Example03()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
		public void Compute()
		{
			L.Mass m = new L.Mass();
			m.kg = 2.66E-26;
			L.Length d = new L.Length();
			d.m = 1.21E-10;
			L.MomentOfInertia I = new L.MomentOfInertia();
			I.ZZ = 2.0*m.kg*d.m/2.0*d.m/2.0;
			result+=Convert.ToString(I.ZZ)+"\r\n";
			L.AngularVelocity omega = new L.AngularVelocity();
			omega.Z = 4.60E12;
			L.KineticEnergy K = new L.KineticEnergy(I,omega);
            result+=Convert.ToString(K.J);
		}
	}
}
